﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Imgur.Net.Auth;
using NUnit.Framework;

namespace Imgur.Net.Test.Auth
{
    [TestFixture]
    public class AnonymousAuthenticationProviderTests
    {
        [Test]
        public void CreateInstance()
        {
            string clientId = "12345";
            var instance = new AnonymousAuthenticationProvider(clientId);

            Assert.IsNotNull(instance);
        }

        [Test]
        [ExpectedException(typeof(ArgumentNullException))]
        public void CreateInstanceNullClientId()
        {
            string clientId = "";
            var instance = new AnonymousAuthenticationProvider(clientId);
        }

        [Test]
        public void GetAuthorizationContextTest()
        {
            string clientId = "12345";
            var instance = new AnonymousAuthenticationProvider(clientId);

            Assert.IsNotNull(instance);

            var result = instance.GetAuthorizationContext();

            Assert.IsNotNull(result);
            Assert.AreEqual(AuthContextType.Anonymous, result.ContextType);
        }
    }
}
